home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / networking / ip / ka9q / osrc.arc / IFACE.H < prev    next >
Encoding:
C/C++ Source or Header  |  1989-03-26  |  1.6 KB  |  51 lines

  1. #ifndef    NULLIF
  2.  
  3. #include "global.h"
  4.  
  5. /* Interface control structure */
  6. struct iface {
  7.     struct iface *next;    /* Linked list pointer */
  8.     char *name;        /* Ascii string with interface name */
  9.     int (*ioctl)();        /* Function to handle device control */
  10.     int (*send)();        /* Routine to send an IP datagram */
  11.     int (*output)();    /* Routine to send link packet */
  12.     int (*raw)();        /* Routine to call to send raw packet */
  13.     int (*stop)();        /* Routine to call before detaching */
  14.     int16 mtu;        /* Maximum transmission unit size */
  15.     int16 dev;        /* Subdevice number to pass to send */
  16.     int16 flags;        /* Configuration flags */
  17. #define    DATAGRAM_MODE    0    /* Send datagrams in raw link frames */
  18. #define    CONNECT_MODE    1    /* Send datagrams in connected mode */
  19.     int16 trace;        /* Trace flags */
  20. #define    IF_TRACE_OUT    0x01    /* Output packets */
  21. #define    IF_TRACE_IN    0x10    /* Packets to me except broadcast */
  22. #define    IF_TRACE_ASCII    0x100    /* Dump packets in ascii */
  23. #define    IF_TRACE_HEX    0x200    /* Dump packets in hex/ascii */
  24.     char *hwaddr;        /* Device hardware address, if any */
  25.     struct iface *forw;    /* Forwarding interface for output, if rx only */
  26. };
  27. #define    NULLIF    (struct iface *)0
  28. extern struct iface *Ifaces;    /* Head of interface list */
  29.  
  30. /* Header put on front of each packet in input queue */
  31. struct phdr {
  32.     struct iface *iface;
  33.     unsigned short type;
  34. #define    TYPE_AX25    0
  35. #define    TYPE_ETHER    1
  36. #define    TYPE_IP        2
  37. #define TYPE_APPLETALK    3
  38. #define    TYPE_KISS    4
  39. #define    NTYPE        5
  40. };
  41.  
  42. #if    defined(__STDC__) || defined(__TURBOC__)
  43. struct iface *if_lookup(char *name);
  44. #else
  45. struct iface *if_lookup();
  46. #endif
  47.  
  48. #endif    /* NULLIF */
  49.  
  50.  
  51.